package org.linlinjava.litemall.admin.web2.order.resp;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.linlinjava.litemall.core.util.DateTimeUtil;
import org.linlinjava.litemall.db.domain.TGoods;
import org.linlinjava.litemall.db.domain.TGroupOrder;
import org.linlinjava.litemall.db.domain.TUser2;

/**
 * 支付未成团
 */
@ApiModel
public class OResp6 {

    @ApiModelProperty("创建时间")
    private String createdTime;
    @ApiModelProperty("团订单号")
    private String transNo;
    @ApiModelProperty("几人团")
    private Integer joinMax;
    @ApiModelProperty("当前参团人数")
    private Integer joinNum;
    @ApiModelProperty("当前已收货人数")
    private Integer receivedNum;
    @ApiModelProperty("团长昵称")
    private String leaderName;
    @ApiModelProperty("团长手机号")
    private String leaderPhone;
    @ApiModelProperty("团购商品")
    private String goodsName;
    @ApiModelProperty("团购价")
    private String goodsPrice;

    public void pushOrder(TGroupOrder order) {
        if (order != null) {
            createdTime = order.getCreatedTime().format(DateTimeUtil.format);
            transNo = order.getTransNo();
            joinMax = order.getJoinMax();
            joinNum = order.getJoinNum();
            receivedNum = order.getReceivedNum();
            if (receivedNum == null)
                receivedNum = 0;
        }
    }

    public void pushUser(TUser2 user) {
        if (user != null) {
            leaderName = user.getName();
            leaderPhone = user.getPhone();
        }
    }

    public void pushGoods(TGoods goods) {
        if (goods != null) {
            goodsName = goods.getMainTitle();
            goodsPrice = goods.getCurrentPrice().toString();
        }
    }

    public String getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(String createdTime) {
        this.createdTime = createdTime;
    }

    public String getTransNo() {
        return transNo;
    }

    public void setTransNo(String transNo) {
        this.transNo = transNo;
    }

    public Integer getJoinMax() {
        return joinMax;
    }

    public void setJoinMax(Integer joinMax) {
        this.joinMax = joinMax;
    }

    public Integer getJoinNum() {
        return joinNum;
    }

    public void setJoinNum(Integer joinNum) {
        this.joinNum = joinNum;
    }

    public Integer getReceivedNum() {
        return receivedNum;
    }

    public void setReceivedNum(Integer receivedNum) {
        this.receivedNum = receivedNum;
    }

    public String getLeaderName() {
        return leaderName;
    }

    public void setLeaderName(String leaderName) {
        this.leaderName = leaderName;
    }

    public String getLeaderPhone() {
        return leaderPhone;
    }

    public void setLeaderPhone(String leaderPhone) {
        this.leaderPhone = leaderPhone;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public String getGoodsPrice() {
        return goodsPrice;
    }

    public void setGoodsPrice(String goodsPrice) {
        this.goodsPrice = goodsPrice;
    }
}
